import React, { PureComponent, Fragment } from 'react';
import { notification, Icon, Tree, Modal } from 'antd';
import { connect } from 'dva';
import "../../views/renforce/index.less"
import ToolConfigModals from '../../components/toolConfigModals';
import { cloneDeep } from "lodash"
import { bus } from "../../utils/bus"
const { TreeNode } = Tree;
class ContinuousRigidFrame extends PureComponent {
    constructor(props) {
        super(props);
        this.state = {
            tindex: 0,
            loading: false,
            mode: "add",
            checkedAll: true,
            nodeId: 11,
            situation: "pileCrossSection",
            loadedKeys: [],
            expandedKeys: [],
            autoExpandParent: false,
            tabs: null,
            created: false,
        }
        this.submit = this.submit.bind(this)
        this.tabChange = this.tabChange.bind(this)
        this.renderTreeNodes = this.renderTreeNodes.bind(this)
        this.getTargetNodes = this.getTargetNodes.bind(this)
        this.insertTreeNode = this.insertTreeNode.bind(this)
        this.removeTreeNode = this.removeTreeNode.bind(this)
        this.getTreeNode = this.getTreeNode.bind(this)
        this.updateTreeNode = this.updateTreeNode.bind(this)
        this.onSelect = this.onSelect.bind(this)
        this.loadData = this.loadData.bind(this)
        this.onExpand = this.onExpand.bind(this)
        this.loopTreeNode = this.loopTreeNode.bind(this)
        this.deleteNodeData = this.deleteNodeData.bind(this)
        this.iconMultiSelect = this.iconMultiSelect.bind(this)
    }
    deleteNodeData(e, item) {
        e.preventDefault();
        e.stopPropagation()
        Modal.confirm({
            title: "提示",
            content: "是否删除当前节点?",
            okText: "确定",
            cancelText: "取消",
            onOk: () => {
                if (item.key.includes("pileCrossSectionUnit")) {
                    const id = item.key.replace(/pileCrossSectionUnit/g, '')
                    this.props.deleteCapReinforcement({ ids: [Number(id)] }, res => {
                        this.removeTreeNode(item.key)
                        this.setState({
                            detail: null,
                            updateTime: null,
                            tdata: null,
                            reinforcementDetailSummary: null,
                            singleMaterialSummary: null,
                            materialSummary: null
                        })
                    }, err => {

                    })
                } else if (item.key.includes("foundCrossSectionUnit")) {
                    const id = item.key.replace(/foundCrossSectionUnit/g, '')
                    this.props.deleteCushionStone({ ids: [Number(id)] }, res => {
                        this.removeTreeNode(item.key)
                        this.setState({
                            detail: null,
                            updateTime: null,
                            tdata: null,
                            reinforcementDetailSummary: null,
                            singleMaterialSummary: null,
                            materialSummary: null
                        })
                    }, err => {

                    })
                } else if (item.key.includes("pileFoundCrossSectionUnit")) {
                    const id = item.key.replace(/pileFoundCrossSectionUnit/g, '')
                    this.props.deletePileReinforcement({ ids: [Number(id)] }, res => {
                        this.removeTreeNode(item.key)
                        this.setState({
                            detail: null,
                            updateTime: null,
                            tdata: null,
                            reinforcementDetailSummary: null,
                            singleMaterialSummary: null,
                            materialSummary: null
                        })
                    }, err => {

                    })

                }
            },
            onCancel: () => {

            }
        })

    }

    getTreeNode(data, key) {
        let obj;
        function getOneTarget(data, key) {
            if (data && data.length) {
                const len = data.length;
                for (let i = 0; i < len; i++) {
                    let item = data[i];
                    item.selected = false
                    if (item && item.id == key) {
                        obj = item;
                    } else {
                        if (item && item.children && item.children.length) {
                            getOneTarget(item.children, key)
                        }
                    }
                }
            }
            return obj;
        }
        return getOneTarget(data, key)
    }
    iconMultiSelect(e) {
        e.preventDefault();
        const irons=document.querySelector("input[name='concreteProtectLayer']").value
        if (this.state.modalContext) {
            this.state.modalContext.updateModal({
                visible: true,
                title: "选择钢筋等级",
                event: { code: 'iconMultiSelect' },
                extra: {
                    irons
                }
            });
        }
    }
    getTargetNodes(data, key, remove) {//数组|字符串,remove控制删除
        let target;
        let isArray = key instanceof Array;
        let targets = []
        function oneTarget(list) {
            const len = list.length;
            for (let i = 0; i < len; i++) {
                let item = list[i];
                if (!isArray) {
                    if (item && item.key == key) {
                        target = item;
                        if (remove) {
                            list.splice(i, 1)
                        }
                        break;
                    } else {
                        if (item && item.children && item.children.length) {
                            oneTarget(item.children)
                        }
                    }
                } else {
                    if (key && key.length) {
                        const len2 = key.length
                        for (let j = 0; j < len2; j++) {
                            const item2 = key[j];
                            if (item && item.key == item2) {
                                targets.push(item);
                                if (remove) {
                                    list.splice(i, 1)
                                }
                                break;
                            } else {
                                if (item && item.children && item.children.length) {
                                    oneTarget(item.children)
                                }
                            }
                        }
                    }
                }

            }
            return isArray ? targets : target
        }
        return oneTarget(data)
    }
    removeTreeNode(keys) {
        let data = this.state.tabs;
        if (keys) {
            let res = this.getTargetNodes(data, keys, true)
            this.setState({
                tabs: [...this.state.tabs]
            })
        }

    }
    insertTreeNode(key, obj) {//单个|多个节点插入
        let data = this.state.tabs;
        let target = this.getTargetNodes(data, key)
        let isArray = target instanceof Array;
        let isArray2 = obj instanceof Array;
        if (!isArray) {
            if (target) {
                if (target.children && target.children.length) {
                    if (!isArray2) {
                        if (!target.children.find(item => item && item.key == obj.key)) {
                            target.children.push(obj)
                        }
                    } else {
                        if (obj && obj.length) {
                            const len = obj.length;
                            for (let i = 0; i < len; i++) {
                                let item = obj[i];
                                if (!target.children.find(item2 => item2 && item2.key == item.key)) {
                                    target.children.push(item)

                                }
                            }
                        }
                    }
                } else {
                    // target.children = !isArray2 ? [obj] : obj
                }


            }
        } else {
            if (target && target.length) {
                for (let i = 0; i < target.length; i++) {
                    let item = target[i];
                    if (item.children && item.children.length) {
                        if (!isArray2) {
                            if (!item.children.find(item2 => item2 && item2.key == item.key)) {
                                item.children.push(obj)
                            }
                        } else {
                            if (obj && obj.length) {
                                for (let j = 0; j < obj.length; j++) {
                                    let item2 = obj[j];
                                    if (!item.children.find(item3 => item3 && item3.key == item2.key)) {
                                        item.children.push(item2)
                                    }
                                }
                            }
                        }
                    } else {
                        // item.children = !isArray2 ? [obj] : obj
                    }

                }
            }
        }
        // this.setState({
        //     tabs: [...data]
        // })
    }
    validate(str) {
        let reg = true;
        if (str.includes("+")) {
            let arr = str.split("+");
            const len = arr.length;
            for (let i = 0; i < len; i++) {
                let item = arr[i];
                try {
                    eval(item)
                } catch (error) {
                    reg = false
                }
            }
        } else {
            reg = typeof (str - 0) == "number" ? true : false
        }
        return reg;
    }
    submit(e) {
        e.preventDefault();
        e.stopPropagation();
        const nlist1=document.querySelectorAll(".form1 .input")
        const len=nlist1.length;
        let steelStructureMain={},steelStructureLmPm={};
        for (let i = 0; i < len; i++) {
            let node = nlist1[i];
            node.classList.remove("required")
            if (!node.value) {
                node.classList.add("required")
                notification.warn({ message: `请将${node.dataset.name}字段填写完整` })
                this.setState({
                    loading: false,
                })
                return;
            }
            
            steelStructureMain[node.dataset.key] = node.value;
        }
        const nlist2=document.querySelectorAll(".form2 .input")
        const len2=nlist2.length;
        for (let i = 0; i < len2; i++) {
            let node = nlist2[i];
            node.classList.remove("required")
            if (!node.value) {
                node.classList.add("required")
                notification.warn({ message: `请将${node.dataset.name}字段填写完整` })
                this.setState({
                    loading: false,
                })
                return;
            }
            steelStructureLmPm[node.dataset.key] = node.value;
        }
        const nlist3=document.querySelectorAll(".form3 .input")
        const len3=nlist3.length;
        let steelStructureCurve={}
        for (let i = 0; i < len3; i++) {
            let node = nlist3[i];
            node.classList.remove("required")
            if (!node.value) {
                node.classList.add("required")
                notification.warn({ message: `请将${node.dataset.name}字段填写完整` })
                this.setState({
                    loading: false,
                })
                return;
            }
            if (node.dataset.validate) {
               
                if (!this[node.dataset.validate](node.value)) {
                    node.classList.add("required")
                    notification.warn({ message: `${node.dataset.name}字段格式不正确!` })
                    return;
                }
            }
            steelStructureCurve[node.dataset.key] = node.value;
        }
        const nlist4=document.querySelectorAll(".form4 .input")
        const len4=nlist4.length;
        let steelStructureBeam={}
        for (let i = 0; i < len4; i++) {
            let node = nlist4[i];
            node.classList.remove("required")
            if (!node.value) {
                node.classList.add("required")
                notification.warn({ message: `请将${node.dataset.name}字段填写完整` })
                this.setState({
                    loading: false,
                })
                return;
            }
            steelStructureBeam[node.dataset.key] = node.value;
        }
        this.props.addSteelStructure({steelStructureMain,steelStructureLmPm,steelStructureCurve,steelStructureBeam},res=>{

        },err=>{

        })

    }
    componentWillUnmount() {
        sessionStorage.setItem("hisPre", this.props.location.pathname)
        bus.off("ironSelect")
    }
    async componentDidMount() {
        if (!sessionStorage.getItem("isLogin")) {
            this.props.history.push("/login")
            return;
        }
        const { dictlist } = this.props;
       
        bus.on("ironSelect", iron => {
            const node = document.querySelector("#iron");
            node.value = iron.join(",")
        })
        const list = document.querySelectorAll(".titleCheck")
        const len = list.length;
        for (let i = 0; i < len; i++) {
            let node = list[i];
            node.checked = true
        }
        
        let res=this.loopTreeNode(await this.props.beamConstructionTree())
        const expandedKeys = res.map(item => item.key)
        this.setState({
            tabs:res,
            expandedKeys,
            concreteNo: dictlist.filter(item => item.dictType == "concrete_no"),
            erectionHorizontalReinforcementSpacing: dictlist.filter(item => item.dictType == "erection_horizontal_reinforcement_spacing"),
        })

    }

    renderTreeNodes(data) {
        return data.map(item => {
            if (item.children && !item.hidden) {
                return (
                    <TreeNode checkable={item.checkable} title={item.title} key={item.key} dataRef={item}>
                        {this.renderTreeNodes(item.children)}
                    </TreeNode>
                );
            }
            return !item.hidden ? <TreeNode checkable={item.checkable} title={item.title} key={item.key} {...item} dataRef={item}></TreeNode> : undefined;

        });
    }
    tabChange(e, index) {
        e.preventDefault();

        this.setState({
            tindex: index
        })
    }
    onExpand(expandedKeys) {
        this.setState({
            expandedKeys: expandedKeys,
            autoExpandParent: false,
        })
    }
    loopTreeNode(data) {
        let _this = this;
        function loop(list) {
            if (list && list.length) {
                const len = list.length;
                for (let i = 0; i < len; i++) {
                    let item = list[i]
                    item.title=item.name;
                    item.key=item.id;
                    if (item && item.children && item.children.length) {
                        loop(item.children)
                    } else {
                        continue;
                    }
                }

            }
            return list;
        }
        return loop(data)
    }
    async onSelect(keys, e) {
        let dataRef = e.node.props.dataRef
        const { situation } = this.state;
        let eventType;
        if (dataRef) {
            eventType = dataRef.key
        } else {
            dataRef = e.node.props
            eventType = dataRef.eventKey
        }
        // await this.setState({
        //     situation: null,
        //     loading: true,
        //     selectedKeys: keys,
        //     detail: null,
        //     updateTime: null,
        //     tdata: null,
        //     reinforcementDetailSummary: null,
        //     singleMaterialSummary: null,
        //     materialSummary: null
        // })
        // var cache = [];
        // let dataRefC = JSON.parse(JSON.stringify(dataRef, function (key, value) {
        //     if (typeof value === 'object' && value !== null) {
        //         if (cache.indexOf(value) !== -1) {
        //             return;
        //         }
        //         cache.push(value);
        //     }
        //     return value;
        // }))
        // cache = null;

        // if (eventType && eventType == "pileCrossSection") {



        // } else if (eventType && eventType.includes("pileCrossSectionUnit")) {


        // } else if (eventType && eventType == "foundCrossSection") {


        // } else if (eventType && eventType.includes("foundCrossSectionUnit")) {

        // } else if (eventType && eventType == "pileFoundCrossSection") {

        // } else if (eventType && eventType.includes("pileFoundCrossSectionUnit")) {

        // }
        // this.setState({
        //     loading: false
        // })


    }
    updateTreeNode(key, list) {
        let data = this.state.tabs;
        let target = this.getTargetNodes(data, key)
        if (target) {
            target.children = list
        }
        this.setState({
            data: [...data]
        })
    }
    loadData(e) {

        return new Promise(async (resolve, reject) => {
            let { loadedKeys } = this.state;
            const { project } = this.props;
            let { eventKey, dataRef } = e.props
            if (!loadedKeys.includes(eventKey)) {
                loadedKeys.push(eventKey)
            }

            if (e.props.children && e.props.children.length) {
                resolve()
                return;
            }
            if (!dataRef) {
                dataRef = cloneDeep(e.props)
                dataRef.rg = true;
                delete dataRef.context
            }
            if (eventKey == "pileCrossSection") {
                let res = await this.props.capReinforcementList({ projectId: project.id })
                if (res && res.length) {
                    const len = res.length
                    for (let i = 0; i < len; i++) {
                        let item = res[i];
                        item.key = "pileCrossSectionUnit" + item.id;
                        item.title = "方案:" + item.configureName;

                        item.isLeaf = true
                        if (item.isLeaf) {
                            item.title = <span>{item.title}&nbsp;&nbsp;<Icon onClick={e => this.deleteNodeData(e, item)} type="delete" /></span>
                        }
                    }
                    dataRef.children = res
                }
                if (dataRef.rg) {
                    this.updateTreeNode(dataRef.eventKey, res)
                }

            } else if (eventKey == "foundCrossSection") {
                let res = await this.props.cushionStoneList({ projectId: project.id });
                if (res && res.length) {
                    const len = res.length
                    for (let i = 0; i < len; i++) {
                        let item = res[i];
                        item.key = "foundCrossSectionUnit" + item.id;
                        item.title = "方案:" + item.configureName;
                        item.isLeaf = true;
                        if (item.isLeaf) {
                            item.title = <span>{item.title}&nbsp;&nbsp;<Icon onClick={e => this.deleteNodeData(e, item)} type="delete" /></span>
                        }
                    }
                    dataRef.children = res
                }
                if (dataRef.rg) {
                    this.updateTreeNode(dataRef.eventKey, res)
                }
            } else if (eventKey == "pileFoundCrossSection") {
                let res = await this.props.pileReinforcementList({ projectId: project.id });
                if (res && res.length) {
                    const len = res.length
                    for (let i = 0; i < len; i++) {
                        let item = res[i];
                        item.key = "pileFoundCrossSectionUnit" + item.id;
                        item.title = "方案:" + item.configureName;
                        item.isLeaf = true;
                        if (item.isLeaf) {
                            item.title = <span>{item.title}&nbsp;&nbsp;<Icon onClick={e => this.deleteNodeData(e, item)} type="delete" /></span>
                        }
                    }
                    dataRef.children = res
                }
                if (dataRef.rg) {
                    this.updateTreeNode(dataRef.eventKey, res)
                }
            }

            this.setState({
                tabs: [...this.state.tabs]
            })
            resolve()

        })
    }
    render() {
        const { loading, loadedKeys, expandedKeys, selectedKeys, tabs, concreteNo, erectionHorizontalReinforcementSpacing } = this.state;

        const { project } = this.props;
        return (
            <div className="continuousRigidFrameBox">
                <div className="nav">
                    连续钢构计算<button onClick={this.submit}>提交</button>
                </div>
                <div className="main">
                    <div className="left">
                        <div style={{ padding: "10px 15px" }}>
                            {
                                tabs? <Tree
                                loadedKeys={loadedKeys}
                                defaultExpandAll
                                selectedKeys={selectedKeys}
                                loadData={(e) => this.loadData(e)}
                                treeData={tabs}
                                onSelect={this.onSelect}>
                                {tabs ? this.renderTreeNodes(tabs) : null}

                            </Tree>:undefined
                            }
                           
                        </div>
                    </div>
                    <div style={loading ? { opacity: 0 } : { opacity: 1 }} className="center tableBox">
                        <div className="form1" >
                            <input hidden type="checkbox" className="titleCheck" id="trigger-views" />
                            <label className="bold required title" for="trigger-views">总体信息(单位:cm)</label>
                            <table style={{ marginTop: "40px" }}>
                                <tbody>
                                    <tr>
                                        <td >混凝土标号</td>
                                        <td className="nopadd"> <select data-key="concreteNo" className="input" data-name="混凝土标号" >
                                            {
                                                concreteNo && concreteNo.length ? concreteNo.map((item, index) => {
                                                    return <option key={"concreteNo" + index} value={item.dictLabel}>{item.dictLabel}</option>
                                                }) : undefined
                                            }

                                        </select></td>
                                    </tr>
                                    <tr>
                                        <td >钢筋等级</td>
                                        <td onClick={this.iconMultiSelect} className="nopadd rightIcon">
                                            <input id="iron" className="input" disabled data-name="钢筋等级" name="concreteProtectLayer" data-key="concreteProtectLayer" type="text" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >混凝土保护层(外)</td>
                                        <td><input data-key="concreteOuterProtectLayer" data-handler="*10" defaultValue="6" data-name="混凝土保护层" className="input" type="number" /></td>
                                    </tr>
                                    <tr>
                                        <td >混凝土保护层(内)</td>
                                        <td><input data-key="concreteInnerProtectLayer" data-handler="*10" defaultValue="6" data-name="混凝土保护层" className="input" type="number" /></td>
                                    </tr>



                                </tbody>
                            </table>
                        </div>
                        <div className="form2">
                            <input hidden type="checkbox" className="titleCheck" id="trigger-views2" />
                            <label className="bold required title" for="trigger-views2">0号块立面、平面信息(单位:cm)</label>
                            <table style={{ marginTop: "40px" }}>
                                <tbody>
                                    <tr>
                                        <td >箱室个数</td>
                                        <td className="nopadd"><input defaultValue="3" data-key="compartmentNumber"data-name="箱室个数" className="input" type="number" /></td>
                                    </tr>
                                    <tr>
                                        <td >边肋中心距</td>
                                        <td><input data-key="sideDistance" defaultValue="1220" data-name="边肋中心距" className="input" type="text" /></td>
                                    </tr>
                                    <tr>
                                        <td >边箱宽度</td>
                                        <td className="nopadd"><input defaultValue="100" data-key="sideComportmentWidth" data-name="边箱宽度" className="input" type="number" /></td>
                                    </tr>
                                    <tr>
                                        <td >边肋宽度</td>
                                        <td className="nopadd"><input defaultValue="80" data-key="sideWidth" data-name="边肋宽度" className="input" type="number" /></td>
                                    </tr>
                                    <tr>
                                        <td >中肋宽度</td>
                                        <td className="nopadd"><input defaultValue="80" data-key="midWidth" data-name="中肋宽度" className="input" type="number" /></td>
                                    </tr>

                                    <tr>
                                        <td >立面顶板倒角宽度*高度</td>
                                        <td className="nopadd"><select data-handler="*10" data-key="lmTopChamferingSize" className="input" data-name="立面顶板倒角宽度*高度" >
                                            {
                                                erectionHorizontalReinforcementSpacing && erectionHorizontalReinforcementSpacing.length ? erectionHorizontalReinforcementSpacing.map((item, index) => {
                                                    return <option key={"erectionHorizontalReinforcementSpacing" + index} value={item.dictLabel.split("*").map(item => item / 10).join("*")}>{item.dictLabel.split("*").map(item => item / 10).join("*")}</option>
                                                }) : undefined
                                            }

                                        </select></td>
                                    </tr>
                                    <tr>
                                        <td >立面底板倒角宽度*高度</td>
                                        <td className="nopadd"><select data-handler="*10" data-key="lmBottomChamferingSize" className="input"data- name="立面底板倒角宽度*高度" >
                                            {
                                                erectionHorizontalReinforcementSpacing && erectionHorizontalReinforcementSpacing.length ? erectionHorizontalReinforcementSpacing.map((item, index) => {
                                                    return <option key={"erectionHorizontalReinforcementSpacing" + index} value={item.dictLabel.split("*").map(item => item / 10).join("*")}>{item.dictLabel.split("*").map(item => item / 10).join("*")}</option>
                                                }) : undefined
                                            }

                                        </select></td>
                                    </tr>
                                    <tr>
                                        <td >立面箱室顶倒角宽度*高度</td>
                                        <td className="nopadd"><select data-handler="*10" data-key="lmCompartmentTopChamferingSize" className="input" data-name="立面箱室顶倒角宽度*高度" >
                                            {
                                                erectionHorizontalReinforcementSpacing && erectionHorizontalReinforcementSpacing.length ? erectionHorizontalReinforcementSpacing.map((item, index) => {
                                                    return <option key={"erectionHorizontalReinforcementSpacing" + index} value={item.dictLabel.split("*").map(item => item / 10).join("*")}>{item.dictLabel.split("*").map(item => item / 10).join("*")}</option>
                                                }) : undefined
                                            }

                                        </select></td>
                                    </tr>
                                    <tr>
                                        <td >立面箱室底倒角宽度*高度</td>
                                        <td className="nopadd"><select data-handler="*10" data-key="lmCompartmentBottomChamferingSize" className="input" data-name="立面箱室底倒角宽度*高度" >
                                            {
                                                erectionHorizontalReinforcementSpacing && erectionHorizontalReinforcementSpacing.length ? erectionHorizontalReinforcementSpacing.map((item, index) => {
                                                    return <option key={"erectionHorizontalReinforcementSpacing" + index} value={item.dictLabel.split("*").map(item => item / 10).join("*")}>{item.dictLabel.split("*").map(item => item / 10).join("*")}</option>
                                                }) : undefined
                                            }

                                        </select></td>
                                    </tr>
                                    <tr>
                                        <td >平面倒角宽度*高度</td>
                                        <td className="nopadd"><select data-handler="*10" data-key="pmChamferingSize" className="input" data-name="立面箱室底倒角宽度*高度" >
                                            {
                                                erectionHorizontalReinforcementSpacing && erectionHorizontalReinforcementSpacing.length ? erectionHorizontalReinforcementSpacing.map((item, index) => {
                                                    return <option key={"erectionHorizontalReinforcementSpacing" + index} value={item.dictLabel.split("*").map(item => item / 10).join("*")}>{item.dictLabel.split("*").map(item => item / 10).join("*")}</option>
                                                }) : undefined
                                            }

                                        </select></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div style={loading ? { opacity: 0 } : { opacity: 1 }} className="right tableBox">
                        <div className="form3">
                            <input hidden type="checkbox" className="titleCheck" id="trigger-views3" />
                            <label className="bold required title" for="trigger-views3">曲线变化控制点信息(单位:cm)</label>
                            <table style={{ marginTop: "40px" }}>
                                <tbody>
                                    <tr>
                                        <td >跨径布置</td>
                                        <td className="nopadd">  <input data-key="spanAssign" data-validate="validate" data-handler="*10" defaultValue="115000+22000+115000" data-name="跨径布置" className="input" type="text" /></td>
                                        <td >抛物线次数</td>
                                        <td className="nopadd">
                                            <input data-key="parabolaDegree" data-handler="*10" defaultValue="2.0" data-name="抛物线次数" className="input" type="number" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >梁段划分</td>
                                        <td colSpan="3"><input data-key="beamSegmentDivision" data-validate="validate" data-handler="*10" defaultValue="650+7*350+6*400+12*450" data-name="梁段划分" className="input" type="text" /></td>

                                    </tr>
                                    <tr>
                                        <td >梁高变化起点高度</td>
                                        <td className="nopadd">  <input data-key="beamStartHeight" data-handler="*10" defaultValue="500" data-name="梁高变化起点高度" className="input" type="number" /></td>
                                        <td >梁高变化终点高度</td>
                                        <td className="nopadd">
                                            <input data-key="beamEndHeight" data-handler="*10" defaultValue="1350" data-name="梁高变化终点高度" className="input" type="number" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >梁高曲线变化段起点</td>
                                        <td className="nopadd">  <input data-key="beamCurveStartStation" data-handler="*10" defaultValue="10900" data-name="梁高曲线变化段起点" className="input" type="number" /></td>
                                        <td >梁高曲线变化段长度</td>
                                        <td className="nopadd">
                                            <input data-key="beamCurveChangeLength" data-handler="*10" defaultValue="10250" data-name="梁高曲线变化段长度" className="input" type="number" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >梁高直线变化段起点</td>
                                        <td className="nopadd">  <input data-key="beamStraightStartStation" data-handler="*10" defaultValue="0"data-name="梁高直线变化段起点" className="input" type="number" /></td>
                                        <td >梁高变化起点高度</td>
                                        <td className="nopadd">
                                            <input data-key="beamStartHeight" data-handler="*10" defaultValue="150" data-name="梁高变化起点高度" className="input" type="number" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >梁高变化终点高度</td>
                                        <td className="nopadd">  <input data-key="beamEndHeight" data-handler="*10" defaultValue="1350" data-name="梁高变化终点高度" className="input" type="number" /></td>
                                        <td >梁高直线变化段长度</td>
                                        <td className="nopadd">
                                            <input data-key="beamStraightChangeLength" data-handler="*10" defaultValue="0" data-name="梁高直线变化段长度" className="input" type="number" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >底板变厚起点厚度</td>
                                        <td className="nopadd">  <input data-key="bottomThickenStartThickness" data-handler="*10" defaultValue="32" data-name="底板变厚起点厚度" className="input" type="number" /></td>
                                        <td >底板直线变厚段起点</td>
                                        <td className="nopadd">
                                            <input data-key="bottomStraightThickenStartStation" data-handler="*10" defaultValue="10000" data-name="底板直线变厚段起点" className="input" type="number" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >底板变厚终点厚度</td>
                                        <td className="nopadd">  <input data-key="bottomStraightThickenEndThickness" data-handler="*10" defaultValue="150" data-name="底板变厚终点厚度" className="input" type="number" /></td>
                                        <td >底板直线变厚段长度</td>
                                        <td className="nopadd">
                                            <input data-key="bottomThickenLength" data-handler="*10" defaultValue="320" data-name="底板直线变厚段长度" className="input" type="number" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >腹板变厚段起点</td>
                                        <td className="nopadd">  <input data-key="plateThickenStation" data-handler="*10" defaultValue="7330" data-name="腹板变厚段起点" className="input" type="number" /></td>
                                        <td >腹板变厚长度及差值</td>
                                        <td className="nopadd">
                                            <input data-key="plateThickenLengthAndDvalue" data-handler="*10" defaultValue="0" data-name="腹板变厚长度及差值" className="input" type="number" />
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div className="form4">
                            <input hidden type="checkbox" className="titleCheck" id="trigger-views4" />
                            <label className="bold required title" for="trigger-views4">端横梁信息(单位:cm)</label>
                            <table style={{ marginTop: "40px" }}>
                                <tbody>
                                    <tr>
                                        <td >横梁长度</td>
                                        <td className="nopadd">  <input data-key="beamLength" data-handler="*10" defaultValue="200" data-name="横梁长度" className="input" type="text" /></td>
                                        <td >腹板变厚段长度</td>
                                        <td className="nopadd">
                                            <input data-key="plateThickenLength" data-handler="*10" defaultValue="200" data-name="腹板变厚段长度" className="input" type="text" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >顶板变厚端长度</td>
                                        <td className="nopadd">  <input data-key="topThickenLength" data-handler="*10" defaultValue="176" data-name="顶板变厚端长度" className="input" type="number" /></td>
                                        <td >底板变厚端长度</td>
                                        <td className="nopadd">
                                            <input data-key="bottomThickenLength" data-handler="*10" defaultValue="176" data-name="底板变厚端长度" className="input" type="number" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >伸缩缝宽度</td>
                                        <td className="nopadd">  <input data-key="expansionJointWidth" data-handler="*10" defaultValue="52.5" data-name="伸缩缝宽度" className="input" type="number" /></td>
                                        <td >伸缩缝高度</td>
                                        <td className="nopadd">
                                            <input data-key="expansionJointHeight" data-handler="*10" defaultValue="32" data-name="伸缩缝高度" className="input" type="number" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >梁端缝宽度</td>
                                        <td className="nopadd">  <input data-key="beamJointWidth" data-handler="*10" defaultValue="24" data-name="梁端缝宽度" className="input" type="number" /></td>
                                        <td >边跨合拢段长度</td>
                                        <td className="nopadd">
                                            <input data-key="sideJoinLength" data-handler="*10" defaultValue="200" data-name="边跨合拢段长度" className="input" type="number" />
                                        </td>
                                    </tr>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <ToolConfigModals
                    onLoaded={context => {
                        this.setState({ modalContext: context })
                    }}
                />
            </div>
        )
    }
}
export default connect(
    ({ dict: { dictlist }, project: { current }, }) => ({ dictlist, project: current }),
    dispatch => ({
        addSteelStructure: (values, onSuccess, onError) => dispatch({
            type: 'calculate/addSteelStructure',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        beamConstructionTree: (values) => dispatch({
            type: 'calculate/beamConstructionTree',
            payload: values
        }),
        addCapReinforcement: (values, onSuccess, onError) => dispatch({
            type: 'renforce/addCapReinforcement',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        addCushionStone: (values, onSuccess, onError) => dispatch({
            type: 'renforce/addCushionStone',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        addPileReinforcement: (values, onSuccess, onError) => dispatch({
            type: 'renforce/addPileReinforcement',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        deleteCapReinforcement: (values, onSuccess, onError) => dispatch({
            type: 'renforce/deleteCapReinforcement',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        exportCapReinforcement: (values, onSuccess, onError) => dispatch({
            type: 'renforce/exportCapReinforcement',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        deleteCushionStone: (values, onSuccess, onError) => dispatch({
            type: 'renforce/deleteCushionStone',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        deletePileReinforcement: (values, onSuccess, onError) => dispatch({
            type: 'renforce/deletePileReinforcement',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        updateCapReinforcement: (values, onSuccess, onError) => dispatch({
            type: 'renforce/updateCapReinforcement',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        updateCushionStone: (values, onSuccess, onError) => dispatch({
            type: 'renforce/updateCushionStone',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        updatePileReinforcement: (values, onSuccess, onError) => dispatch({
            type: 'renforce/updatePileReinforcement',
            payload: {
                values,
                onSuccess,
                onError
            }
        }),
        capReinforcementList: (values) => dispatch({
            type: 'renforce/capReinforcementList',
            payload: values
        }),
        cushionStoneList: (values) => dispatch({
            type: 'renforce/cushionStoneList',
            payload: values
        }),
        pileReinforcementList: (values) => dispatch({
            type: 'renforce/pileReinforcementList',
            payload: values
        }),
        getCapReinforcementDetail: (values) => dispatch({
            type: 'renforce/getCapReinforcementDetail',
            payload: values
        }),
        getCushionStoneDetail: (values) => dispatch({
            type: 'renforce/getCushionStoneDetail',
            payload: values
        }),
        getCapReinforcementDetail2: (values) => dispatch({
            type: 'renforce/getCapReinforcementDetail2',
            payload: values
        }),
        crossTempList: (values) => dispatch({
            type: 'renforce/crossTempList',
            payload: values
        }),

    })
)(ContinuousRigidFrame);